Skip to content

[CI] (3f39e0e) react-router/rrv7-starter - #4172

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-3f39e0e-react-router-rrv7-starter
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-3f39e0e-react-router-rrv7-starter

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 3f39e0e
App: react-router/rrv7-starter
App directory: apps/react-router/rrv7-starter
Workbench branch: wizard-ci-3f39e0e-react-router-rrv7-starter
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-23T22:17:52.312Z
Duration: 387.4s

YARA Scanner

✓ 152 tool calls scanned, 0 violations detected

No violations: ✓ 152 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown
Author

Now I have enough context to produce the evaluation.


PR Evaluation Report

Summary

This PR integrates PostHog into a React Router v7 framework mode (SSR-enabled) app called "CloutHub" — a satirical fake influencer social network. It adds posthog-js and @posthog/react, initializes PostHog in entry.client.tsx with PostHogProvider and PostHogErrorBoundary, and adds custom event captures for post likes, follower package selection/purchase, and follow actions.

Files changed Lines added Lines removed
6 +96 -5

Confidence score: 4/5 👍

  • Missing vite.config.ts SSR update: The PostHog docs for React Router v7 framework mode require adding posthog-js and @posthog/react to ssr.noExternal in vite.config.ts. The current config only includes gsap for dev mode. Production builds work (uses noExternal: true), but the dev server may encounter SSR import errors. [MEDIUM]
  • No identify() call: The app has a profile page with a fake user (fakeUser), but no posthog.identify() is ever called. Even for a demo app, calling identify with the fake user's ID on app load would demonstrate the pattern and link events to a known user. [MEDIUM]
  • No reverse proxy configured: No reverse proxy setup for client-side tracking, which the docs recommend for all browser-side PostHog integrations to avoid ad blocker interception. [MEDIUM]

File changes

Filename Score Description
app/entry.client.tsx 4/5 New client entry point initializing PostHog with PostHogProvider and PostHogErrorBoundary. Good env var validation with dev-mode error, graceful fallback when vars are missing.
app/routes/buy-followers.tsx 4/5 Adds follower_package_selected and follower_purchase_completed capture events with enriched properties (price, follower count, bonus). Also uses posthog?.logger for structured logging.
app/components/PostCard.tsx 5/5 Clean addition of post_like_changed event with post_id and is_liked properties in the click handler.
app/routes/profile.tsx 4/5 Adds follow_back_changed event. Removes unused username prop from FollowButton — minor unrelated cleanup.
package.json 5/5 Correctly adds posthog-js and @posthog/react as dependencies.
.env.example 5/5 Documents VITE_POSTHOG_PROJECT_TOKEN and VITE_POSTHOG_HOST env vars.

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Production build works (noExternal: true bundles everything). Dev server may have SSR issues due to missing vite config update.
Preserves existing env vars & configs Yes Existing VITE_SITE_URL preserved, no configs overwritten.
No syntax or type errors Yes All files have valid syntax. Optional chaining used consistently for PostHog calls.
Correct imports/exports Yes posthog-js and @posthog/react imports are correct for client-side usage.
Minimal, focused changes Yes All changes relate to PostHog integration. Minor cleanup of unused username prop is acceptable.
Pre-existing issues None No pre-existing issues found in the base app.

Issues

  • Missing vite.config.ts update for SSR: The PostHog docs for RRv7 framework mode require ssr: { noExternal: ['posthog-js', '@posthog/react'] } in vite.config.ts. The current config externalizes these packages in dev mode (noExternal: ['gsap']), which can cause SSR import errors when the dev server tries to resolve browser-only code. Add 'posthog-js' and '@posthog/react' to the dev-mode noExternal array. [MEDIUM]

Other completed criteria

  • Environment variables documented in .env.example
  • package.json dependencies are valid and correctly versioned
  • Graceful fallback in entry.client.tsx when env vars are missing (app renders without PostHog)

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js ^1.434.12 and @posthog/react ^1.11.1 added to package.json
PostHog client initialized Yes posthog.init() in entry.client.tsx with PostHogProvider wrapping HydratedRouter — correct pattern for RRv7 framework mode
capture() Yes Four meaningful capture calls across three components
identify() No No posthog.identify() call anywhere. App has a profile page with user data that could be used for identification.
Error tracking Yes PostHogErrorBoundary wraps the entire app in entry.client.tsx, covering React rendering errors
Reverse proxy No No reverse proxy configured. App is SSR-enabled with client-side PostHog, so a proxy would improve tracking reliability.

Issues

  • No identify() call: The app has a fakeUser object with user data (visible on the profile page), but posthog.identify() is never called. This means all events are anonymous and cannot be linked to a known user. Add an identify call using the fake user's ID, ideally on app load or in the profile page. [MEDIUM]
  • No reverse proxy: No proxy configured to route PostHog requests through first-party infrastructure. The docs recommend this for all client-side integrations. Consider adding Next.js-style rewrites or Vercel proxy config. [MEDIUM]
  • Root ErrorBoundary not instrumented: The existing ErrorBoundary in root.tsx handles route-level errors (404s, etc.) but does not call posthog.captureException(). While PostHogErrorBoundary covers React rendering errors, route errors caught by the root boundary may not be sent to PostHog. [LOW]

Other completed criteria

  • API key loaded from VITE_POSTHOG_PROJECT_TOKEN environment variable (not hardcoded)
  • API host loaded from VITE_POSTHOG_HOST environment variable
  • defaults: '2026-05-30' correctly set in init config
  • Structured logging configured with logs: { serviceName, environment }
  • PostHog init includes proper validation — throws in dev if env vars are missing

PostHog insights and events ✅

Filename PostHog events Description
app/components/PostCard.tsx post_like_changed Captures post like/unlike with post_id and is_liked state — enables engagement analysis
app/routes/buy-followers.tsx follower_package_selected, follower_purchase_completed Captures the full purchase funnel from package selection to completion, with price, follower count, and bonus count properties
app/routes/profile.tsx follow_back_changed Captures follow/unfollow actions with is_following state
app/entry.client.tsx capturedExceptions (via PostHogErrorBoundary) Error boundary wrapping the entire app captures React rendering exceptions

Issues

No event quality issues found.

Other completed criteria

  • Events represent real user actions (likes, purchases, follows)
  • Events enable product insights — purchase funnel from follower_package_selected → follower_purchase_completed
  • All events include relevant contextual properties (post_id, price, follower_count, is_liked, is_following)
  • No PII in event properties — only IDs, counts, and prices
  • Event names follow consistent snake_case convention with descriptive action names

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants